<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick" type='card'>
      <el-tab-pane :label="item.tab+'('+item.total+')'" :name="item.name" v-for="(item) in tabs" :key='item.id'>
        
      </el-tab-pane>
      <user v-if="tabIndex==0"></user>
      <resume v-else-if="tabIndex==1"></resume>
      <withdrawal v-else-if="tabIndex==2"></withdrawal>
    </el-tabs>
  </div>
</template>

<script>
import formOperate from '@/layout/mixin/formOperate'
import user from './user'
import withdrawal from './withdrawal'
import resume from './resume'
export default {
  props:{
    dataCount:{
      type:Object,
      default:()=>{
        return {}
      }
    }
  },
  name: 'Index',
  mixins: [formOperate],
  data() {
    return {
      activeName: 'first',// tabs默认第几个展开
      tabs:[
        {id:1,tab:'未发布简历用户',name:'first',total:0},
        {id:2,tab:'未审核简历',name:'second',total:0},
        {id:3,tab:'未审核提现',name:'third',total:0}
      ],
      tabIndex:0
    }
  },
  watch:{
    dataCount() {
      this.tabs[0].total = this.dataCount.not_resume || 0
      this.tabs[1].total = this.dataCount.not_verify_resume || 0
      this.tabs[2].total = this.dataCount.not_verify_withdraw || 0
    }
  },
  mounted() {
    this.tabs[0].total = this.dataCount.not_resume || 0
    this.tabs[1].total = this.dataCount.not_verify_resume || 0
    this.tabs[2].total = this.dataCount.not_verify_withdraw || 0
  },
  methods:{
    // tab切换
    handleClick(tab) {
      this.tabIndex = tab.index
    }
  },
  components:{
    user,
    resume,
    withdrawal
  }
}
</script>